package com.myccb.app.view.index;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.myccb.app.R;
import com.myccb.app.base.BaseActivity;
import com.myccb.app.widget.CommonDialog;

/**
 * Created by DELL on 2017/12/25.
 */

public class LoanActivity extends BaseActivity {

    private TextView loan_ues;
    private TextView loan_repay;
    private TextView loan_mine;
    private TextView loan_apply;
    private CommonDialog errorMsgDialog;
    private String loan_tip="1、成为我行的住房贷款客户\n2、提供房产抵押或其他有效担保，联系我行个贷中心办理其他贷款服务\n3、在我行办理更多存款，理财业务";


    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.cloan_main);

        Toolbar toolBar=findViewById(R.id.toolbar);
        setSupportActionBar(toolBar);
        ImageView toolBarLeftImg=findViewById(R.id.toolbar_left_img);
        toolBarLeftImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });



        loan_apply=findViewById(R.id.loan_apply);
        loan_apply.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                errorMsgDialog=new CommonDialog(LoanActivity.this);
                errorMsgDialog.showMessage(loan_tip);
            }
        });

        loan_ues=findViewById(R.id.loan_use);
        loan_ues.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(LoanActivity.this,Loannull.class);
                intent.putExtra("title","支用贷款");
                intent.putExtra("ues1","暂无可提现的贷款");
                intent.putExtra("ues2","快去申请一笔吧");
                startActivity(intent);
            }
        });

        loan_repay=findViewById(R.id.loan_repay);
        loan_repay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(LoanActivity.this,Loannull.class);
                intent.putExtra("title","归还贷款");
                intent.putExtra("ues1","您没有需要归还的贷款");
                intent.putExtra("ues2","快去支用一笔吧");
                startActivity(intent);
            }
        });

        loan_mine=findViewById(R.id.loan_mine);
        loan_mine.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(LoanActivity.this,Loannull.class);
                intent.putExtra("title","我的贷款");
                intent.putExtra("ues1","您还没有贷款");
                intent.putExtra("ues2","快去申请一笔吧");
                startActivity(intent);
            }
        });

    }

}
